﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true" CodeFile="ThongTinBe.aspx.cs" Inherits="Admin_ThongTinBe" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/ecmascript">
        $(document).ready(function () {
            $("#<%=txtNgaySinh.ClientID%>").datepicker({ dateFormat: "dd/mm/yy", maxDate: "+0D" });
            activeMenu(4,0);
        });
    </script>
    <div class="divsize">
        <fieldset>
            <legend>Thông Tin Bé</legend>
            <asp:Label ID="messageKetQua" runat="server" Enabled="false"></asp:Label>
            <%-- // panel hiển thị Thông tin bé --%>
            <asp:Panel ID="panelThongTinBe" runat="server">
                <ol class="form form-clear">
                    <li>
                        <label>Mã bé</label>
                        <asp:TextBox ID="txtMaBe" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Tên bé</label>
                        <asp:TextBox ID="txtTenBe" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Ngày sinh</label>
                        <asp:TextBox ID="txtNgaySinh" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Giới tính</label>                    
                        <asp:DropDownList runat="server" ID="rbtnGioiTinh" Width="70px">
                                    <asp:ListItem Text="Nam" Value="true">
                                    </asp:ListItem>
                                    <asp:ListItem Text="Nữ" Value="false">
                                    </asp:ListItem>
                                </asp:DropDownList>                       
                    </li>
                    <li>
                        <label>Tên bố mẹ</label>
                        <asp:TextBox id="txtTenBoMe" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Số điện thoại</label>
                        <asp:TextBox id="txtSoDienThoai" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Số chứng minh thư</label>
                        <asp:TextBox ID="txtCMT" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label>Địa chỉ</label>
                        <asp:TextBox id="txtDiaChi" runat="server"></asp:TextBox>
                    </li>
                    <li>
                        <label></label>
                        <asp:Button ID="btnThem" runat="server" Text="Thêm" CssClass="btn primary" OnClick="btnThem_Click" />
                        <asp:Button ID="btnSua" runat="server" Text="Sửa" CssClass="btn primary" Enabled="false" OnClick="btnSua_Click" />
                    </li>
                </ol>
            </asp:Panel>
        </fieldset>
    </div>
    <div>
        <fieldset>
            <legend>Danh sách</legend>
            <asp:ListView ID="ListViewThongTinBe" runat="server"                
                          OnItemCommand="ListViewThongTinBe_OnItemCommand"
                          OnItemDeleting="ListViewThongTinBe_OnItemDeleting"
                          OnItemUpdating="ListViewThongTinBe_OnItemUpdating">
                <LayoutTemplate>
                    <table border="1">
                        <tr>
                            <th>Mã bé</th>
                            <th>Tên bé</th>
                            <th>Ngày sinh</th>
                            <th>Giới tính</th>
                            <th>Tên bố mẹ</th>
                            <th>Số điện thoại</th>
                            <th>Chứng minh thư</th>
                            <th>Địa chỉ</th>
                            <th>Thao tác</th>
                        </tr>
                        <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder>
                    </table>
                    <asp:DataPager ID="ThongTinBeDataPager" runat="server" PageSize="10">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Button"
                                ShowFirstPageButton="true"
                                ShowNextPageButton="false"
                                ShowPreviousPageButton="false" />
                            <asp:NumericPagerField ButtonCount="10" />
                            <asp:NextPreviousPagerField ButtonType="Button"
                                ShowLastPageButton="true"
                                ShowNextPageButton="false"
                                ShowPreviousPageButton="false" />
                        </Fields>
                    </asp:DataPager>
                </LayoutTemplate>
                <ItemTemplate>
                    <tr>
                        <td><%# Eval("MaBe") %></td>
                        <td><%# Eval("TenBe") %></td>
                        <td><%# Eval("NgaySinh") %></td>
                        <td><%# Eval("GioiTinh") %></td>
                        <td><%# Eval("TenBoMe") %></td>
                        <td><%# Eval("SDTBoMe") %></td>
                        <td style="width:50px;"><%# Eval("CMT") %></td>
                        <td><%# Eval("DiaChi") %></td>
                        <td style="width:70px;">
                            <asp:LinkButton ID="lbtnSua" ToolTip="Sửa thông tin"
                                runat="server" CommandArgument='<%# Eval("MaBe") %>'
                                CommandName="Update">Sửa</asp:LinkButton>
                            |
                            <asp:LinkButton ID="lbtnXoa" runat="server"
                                CommandArgument='<%# Eval("MaBe") %>'
                                CommandName="Delete"
                                ForeColor="Brown"
                                OnClientClick="return comfirm('Bạn chắc chắn muốn xóa')">Xóa</asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
            </asp:ListView>
        </fieldset>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <ul class="m-melanin-vertical-navigation">
         <li>
                <span class=" ss_sprite ss_shield">&nbsp;</span>
                <a id="A4" href="ThongTinBe.aspx" class="m-melanin-vertical-navigation-link">Danh sách bé</a>
          </li>
    </ul>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
    <asp:Button ID="button_create_ttBe" runat="server" CssClass="btn small primary" Text="Thêm bé" />
</asp:Content>

